Skip to content

fix: translate keys - #4229

Merged
ulemons merged 5 commits into
mainfrom
fix/translate-activities-key
Jun 17, 2026
Merged

fix: translate keys#4229
ulemons merged 5 commits into
mainfrom
fix/translate-activities-key

Conversation

@ulemons

@ulemons ulemons commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

The stewardship escalation activity log was storing the raw enum value as the resolution path (e.g. namespace_takeover), making it unreadable for end users. This PR adds a human-readable label map and uses it when writing the activity log content.

Changes

  • Added ESCALATION_RESOLUTION_PATH_LABELS — a Record<EscalationResolutionPath, string> map that covers all 6 resolution paths; TypeScript enforces exhaustiveness at compile time
  • Updated escalateStewardship() to use the label in the content field of the activity log entry (e.g. "Escalated with resolution path: Namespace Takeover" instead of "...namespace_takeover"); the raw enum value is still preserved in metadata.resolutionPath

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Performance improvement
  • Chore / dependency update
  • Documentation

Note

Low Risk
Display-only mapping on read paths; raw enum values remain in the database and metadata unchanged.

Overview
Escalation activity messages no longer surface raw resolution-path enum keys (e.g. namespace_takeover) in API responses.

A shared ESCALATION_RESOLUTION_PATH_LABELS map and translateActivityContent turn stored content and/or metadata.resolutionPath into readable labels (with a regex fallback for legacy rows that only have the key in content). listPackagesForApi now selects lastActivityMetadata so the public package list can translate lastActivity.content the same way as the stewardship activity feed and package history.

Reviewed by Cursor Bugbot for commit de639e8. Bugbot is set up for automated code reviews on this repo. Configure here.

@ulemons ulemons self-assigned this Jun 17, 2026
Copilot AI review requested due to automatic review settings June 17, 2026 11:14
@ulemons ulemons added the Bug Created by Linear-GitHub Sync label Jun 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the readability of stewardship escalation activity logs by converting stored escalation resolution path enum values (e.g. namespace_takeover) into human-friendly labels when writing the stewardship_activity.content, while still preserving the raw enum in metadata.resolutionPath.

Changes:

  • Added ESCALATION_RESOLUTION_PATH_LABELS: Record<EscalationResolutionPath, string> to map all resolution paths to human-readable labels.
  • Updated escalateStewardship() to use the label map when generating the activity log content string.

Note: the PR title (fix: translate keys) is missing the required JIRA key suffix per .claude/rules/commit-workflow.md (“Format: type: description (CM-XXX)”).


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings June 17, 2026 13:21
ulemons added 3 commits June 17, 2026 15:21
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread services/libs/data-access-layer/src/osspckgs/stewardships.ts
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Copilot AI review requested due to automatic review settings June 17, 2026 13:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread services/libs/data-access-layer/src/osspckgs/stewardships.ts
Comment thread services/libs/data-access-layer/src/osspckgs/stewardships.ts
@ulemons
ulemons merged commit 193a8d5 into main Jun 17, 2026
17 checks passed
@ulemons
ulemons deleted the fix/translate-activities-key branch June 17, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Created by Linear-GitHub Sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants